﻿using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;

namespace GameView.Converts
{
    public class IntToColorConverter : IValueConverter
    {
        public static Dictionary<int, SolidColorBrush> Dic = new()
        {
            [1101] = Brushes.DodgerBlue,//客服
            [1102] = Brushes.MediumSeaGreen,//商人
            [4001] = Brushes.ForestGreen,//"增加",
            [4002] = Brushes.IndianRed,// "扣除",
            [6001] = Brushes.SeaGreen,//"在线",
            [6002] = Brushes.DimGray,//"离线",
            [2501] = Brushes.Firebrick,//"未读",
            [2502] = Brushes.DodgerBlue,//"已读",
            [2001] = Brushes.DodgerBlue,//"待付款",
            [2002] = Brushes.OrangeRed,//"账户异常",
            [2003] = Brushes.ForestGreen,//"已付款",
            [2004] = Brushes.SandyBrown,//"账户异常",
            [2005] = Brushes.Orange,//"已付款",
            [5001] = Brushes.DodgerBlue,//"支付宝",
            [5002] = Brushes.MediumSeaGreen,//"微信",
            [5003] = Brushes.DodgerBlue,//"银联",
            [5004] = Brushes.Violet,//"其他",
            [3001] = Brushes.SeaGreen,//"成功",
            [3002] = Brushes.Firebrick,//失败
            [3003] = Brushes.DimGray,//"取消",
            [3004] = Brushes.DodgerBlue,//"已提交",
            [7002] = Brushes.MediumSeaGreen,//"商人",
            [7003] = Brushes.Teal,//"玩家",
            [0] = Brushes.DimGray,//"未知"
        };

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is int)
            {
                Dic.TryGetValue((int)value, out var res);
                return res;
            }
            return Brushes.Black;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}